atspi: Use gtk_accessible_should_present
authorMatthias Clasen <mclasen@redhat.com>
Mon, 12 Oct 2020 20:39:35 +0000 (16:39 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 13 Oct 2020 01:43:17 +0000 (21:43 -0400)
Replace explicit visibility check by this
more general method of determining whether
an accessible should be presented to the
a11y layer.

gtk/a11y/gtkatspicontext.c

index 27157feda280a689e890a91a1cb6287110039b49..72ca83c821e7625dec482f8acbed673a8616f530 100644 (file)
@@ -316,7 +316,7 @@ get_index_in_parent (GtkWidget *widget)
        child;
        child = gtk_widget_get_next_sibling (child))
     {
-      if (!gtk_widget_get_visible (child))
+      if (!gtk_accessible_should_present (GTK_ACCESSIBLE (child)))
         continue;
 
       if (child == widget)
@@ -425,7 +425,7 @@ handle_accessible_method (GDBusConnection       *connection,
            child;
            child = gtk_widget_get_next_sibling (child))
         {
-          if (!gtk_widget_get_visible (child))
+          if (!gtk_accessible_should_present (GTK_ACCESSIBLE (child)))
             continue;
 
           if (real_idx == idx)
@@ -462,7 +462,7 @@ handle_accessible_method (GDBusConnection       *connection,
            child;
            child = gtk_widget_get_next_sibling (child))
         {
-          if (!gtk_widget_get_visible (child))
+          if (!gtk_accessible_should_present (GTK_ACCESSIBLE (child)))
             continue;
 
           GtkATContext *context = gtk_accessible_get_at_context (GTK_ACCESSIBLE (child));
@@ -561,7 +561,7 @@ handle_accessible_get_property (GDBusConnection       *connection,
            child;
            child = gtk_widget_get_next_sibling (child))
         {
-          if (!gtk_widget_get_visible (child))
+          if (!gtk_accessible_should_present (GTK_ACCESSIBLE (child)))
             continue;
 
           n_children++;